package com.unionpay.mpds.service.impl;

import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import java.util.Map;
import com.unionpay.mpds.util.Pager;
import com.unionpay.mpds.dao.MenuDao;
import com.unionpay.mpds.model.Menu;
import com.unionpay.mpds.service.MenuService;

/**
 * 
 * @description 自动生成 service
 *
 */
@Service
public class MenuServiceImpl extends BaseServiceImpl implements MenuService {
	
	@Autowired
	private MenuDao menuDao;
	
	
	
	
	
	//====================== 基本 C R U D 方法  ===========================
	public Menu get(String id) {
		return menuDao.get(id);
	}
	
	public List<Menu> getAll() {
		return menuDao.findAll();
	}
	
	public List<Menu> findByParam(int size, Map<String, Object> params) {
		return menuDao.findListByParamMap(size, params);
	}
	
	public Pager<Menu> findPager(int pageNo, int pageSize, Map<String, Object> params) {
		return 	menuDao.findByParamMap(pageNo, pageSize, params);
	}
	
	public void save(Menu entity) {
		menuDao.save(entity);
	}
	
	public void update(Menu entity) {
		menuDao.update(entity);
	}
	
	public void delete(String id) {
		menuDao.delete(id);
	}

	@Override
	public List<Menu> getMenusByRole(String roleId) {
		return menuDao.findMenusByRole(roleId);
	}
	
}

